package com.wkh.maker.cli.command;

import cn.hutool.core.io.FileUtil;
import picocli.CommandLine;

import java.io.File;
import java.util.List;

/**
 * @author wkh
 * list是一个辅助命令，作用是遍历输出所有要生成的文件列表
 */
@CommandLine.Command(name = "list",mixinStandardHelpOptions = true,description = "查看文件列表")
public class ListCommand implements Runnable{

    @Override
    public void run() {
        String propertyPath = System.getProperty("user.dir");
        File parentFile = new File(propertyPath).getParentFile();
        String inputPath = new File(parentFile, "xinyuanyi-generator-demo-projects/acm-template").getAbsolutePath();
        List<File> files = FileUtil.loopFiles(inputPath);
        for (File file : files) {
            System.out.println(file.getName());
        }
    }
}
